package com.missilike.core.constant;

public class WechatConstant {

    /**
     * 公众号的全局唯一接口调用凭据
     * appid    应用号的唯一标识
     * secret   应用号的appsecret
     */
    public final static String WECHAT_GET_TOKEN="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${appid}&secret=${secret}";

    /**
     * 通过code换取网页授权access_token
     * appid    应用号的唯一标识
     * secret   应用号的appsecret
     * code     填写第一步获取的code参数
     * grant_type   填写为authorization_code
     */
    public final static  String WECHAT_GET_ACCESS_TOKEN="https://api.weixin.qq.com/sns/oauth2/access_token?grant_type=authorization_code&code=${code}&appid=${appid}&secret=${secret}";

    /**
     * 刷新access_token（如果需要）
     * appid    应用号的唯一标识
     * refresh_token   填写通过access_token获取到的refresh_token参数
     * grant_type   填写为refresh_token
     */
    public final static  String WECHAT_GET_REFRESH_TOKEN="https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=${appid}&grant_type=refresh_token&refresh_token=${refresh_token}";


    /*
     * 通过CODE获取用户信息
     * access_token token
     * code  微信生成的Code
     * */
    public final static String WECHAT_GET_USERINFO="https://api.weixin.qq.com/sns/userinfo?access_token=${access_token}&openid=${openid}&lang=zh_CN";

    /*
     * 获取ticket
     * access_token token
     * code  微信生成的Code
     * */
    public final static String WECHAT_GET_TICKET="https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=${access_token}&type=wx_card";


    /**
     * 检验授权凭证（access_token）是否有效
     */
    public final static String WECHAT_IS_AUTH="https://api.weixin.qq.com/sns/auth?access_token=${access_token}&openid=${openid}";

    //获取access_token填写authorization_code
    public final static String WECHAT_GRANT_TYPE="authorization_code";
    public final static String WECHAT_APPID="client_credential";
    public final static String WECHAT_SECRET="client_credential";

    public final static String WECHAT_USERINFO_LAYER_TOKEN="missilike:wechat:userinfo";
    public final static String WECHAT_SYSTEM_LAYER_TOKEN="missilike:wechat:system";

    public final static String WECHAT_SYSTEM_TICKET ="ticket";
    public final static String WECHAT_SYSTEM_ACCESS_TOKEN ="ticket";
    public final static String WECHAT_SYSTEM_REFRESH_TOKEN ="refresh_token";
}
